
package View;

import Control.ctrProduto;
import java.awt.GraphicsEnvironment;
import javax.swing.JDialog;

public class limProduto extends javax.swing.JFrame {

    private final ctrProduto control;

    public limProduto(ctrProduto objCtrProduto) {
        control = objCtrProduto;
        initComponents();       
        //Centraliza janela
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        int x = ge.getCenterPoint().x - (this.getWidth()/2);
        int y = ge.getCenterPoint().y - (this.getHeight()/2);
        setLocation(x, y);
        //Setar foco na interface superior
        JDialog dia = new JDialog();
        dia.setModal(true);
        dia.setContentPane(getContentPane());
        dia.setBounds(this.getBounds());
        dia.setVisible(true);
        dia.setResizable(false);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panel_produtoPet = new javax.swing.JPanel();
        field_nome1 = new javax.swing.JTextField();
        label_preco = new javax.swing.JLabel();
        label_disponibilidade = new javax.swing.JLabel();
        radio_disponivel = new javax.swing.JRadioButton();
        radio_suspender = new javax.swing.JRadioButton();
        label_produtoPet = new javax.swing.JLabel();
        panel2 = new javax.swing.JPanel();
        label_estoque = new javax.swing.JLabel();
        field_estoque = new java.awt.TextField();
        field_codigo1 = new java.awt.TextField();
        botao_proximo = new javax.swing.JButton();
        botao_primeiro = new javax.swing.JButton();
        botao_anterior = new javax.swing.JButton();
        botao_ultimo = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        botao_excluir = new javax.swing.JButton();
        botao_gravar = new javax.swing.JButton();
        botao_alterar = new javax.swing.JButton();
        botao_novo = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        field_nome = new javax.swing.JTextField();
        label_nome = new javax.swing.JLabel();
        field_marca = new javax.swing.JTextField();
        label_marca = new javax.swing.JLabel();
        label_fornecedor1 = new javax.swing.JLabel();
        combo_unidade = new javax.swing.JComboBox();
        label_descricao = new javax.swing.JLabel();
        scrollPane_descricao = new javax.swing.JScrollPane();
        textArea_descricao = new javax.swing.JTextArea();
        panel1 = new javax.swing.JPanel();
        panel_pesquisar = new javax.swing.JPanel();
        field_pesquisa = new javax.swing.JTextField();
        label_pesquisar = new javax.swing.JLabel();
        label_titulo = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        label_fornecedor = new javax.swing.JLabel();
        combo_fornecedor = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        botao_entrada = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        panel_produtoPet.setBackground(new java.awt.Color(255, 153, 153));

        label_preco.setFont(new java.awt.Font("Tahoma", 0, 14));
        label_preco.setText("Preço de venda:");

        label_disponibilidade.setFont(new java.awt.Font("Tahoma", 0, 14));
        label_disponibilidade.setText("Disponibilidade:");

        radio_disponivel.setBackground(new java.awt.Color(255, 153, 153));
        radio_disponivel.setText("Permitir venda");
        radio_disponivel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radio_disponivelActionPerformed(evt);
            }
        });

        radio_suspender.setBackground(new java.awt.Color(255, 153, 153));
        radio_suspender.setText("Suspender venda");
        radio_suspender.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radio_suspenderActionPerformed(evt);
            }
        });

        label_produtoPet.setFont(new java.awt.Font("Tahoma", 1, 14));
        label_produtoPet.setText("Dados para Vendas");

        javax.swing.GroupLayout panel_produtoPetLayout = new javax.swing.GroupLayout(panel_produtoPet);
        panel_produtoPet.setLayout(panel_produtoPetLayout);
        panel_produtoPetLayout.setHorizontalGroup(
            panel_produtoPetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_produtoPetLayout.createSequentialGroup()
                .addGroup(panel_produtoPetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel_produtoPetLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(panel_produtoPetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panel_produtoPetLayout.createSequentialGroup()
                                .addComponent(label_preco)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(field_nome1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(panel_produtoPetLayout.createSequentialGroup()
                                .addComponent(label_disponibilidade)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(panel_produtoPetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(radio_disponivel, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)
                                    .addComponent(radio_suspender)))))
                    .addGroup(panel_produtoPetLayout.createSequentialGroup()
                        .addGap(44, 44, 44)
                        .addComponent(label_produtoPet)))
                .addContainerGap())
        );
        panel_produtoPetLayout.setVerticalGroup(
            panel_produtoPetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_produtoPetLayout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addComponent(label_produtoPet)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panel_produtoPetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_preco)
                    .addComponent(field_nome1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panel_produtoPetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_disponibilidade)
                    .addComponent(radio_disponivel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(radio_suspender, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        label_estoque.setFont(new java.awt.Font("Tahoma", 0, 14));
        label_estoque.setText("Estoque:");

        field_estoque.setCursor(new java.awt.Cursor(java.awt.Cursor.E_RESIZE_CURSOR));
        field_estoque.setEditable(false);
        field_estoque.setForeground(new java.awt.Color(255, 51, 102));

        field_codigo1.setCursor(new java.awt.Cursor(java.awt.Cursor.E_RESIZE_CURSOR));
        field_codigo1.setEditable(false);
        field_codigo1.setForeground(new java.awt.Color(255, 51, 102));

        botao_proximo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/proximo_registro.gif"))); // NOI18N
        botao_proximo.setToolTipText("Próximo cliente");
        botao_proximo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_proximoActionPerformed(evt);
            }
        });

        botao_primeiro.setFont(new java.awt.Font("Tahoma", 1, 11));
        botao_primeiro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/primeiro_registro.gif"))); // NOI18N
        botao_primeiro.setToolTipText("Ir para o primeiro cliente");
        botao_primeiro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_primeiroActionPerformed(evt);
            }
        });

        botao_anterior.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/registro_anterior.gif"))); // NOI18N
        botao_anterior.setToolTipText("Cliente anterior");
        botao_anterior.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_anteriorActionPerformed(evt);
            }
        });

        botao_ultimo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/ultimo_registro.gif"))); // NOI18N
        botao_ultimo.setToolTipText("Ir para o último cliente");
        botao_ultimo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_ultimoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panel2Layout = new javax.swing.GroupLayout(panel2);
        panel2.setLayout(panel2Layout);
        panel2Layout.setHorizontalGroup(
            panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel2Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(label_estoque)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(field_estoque, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(panel2Layout.createSequentialGroup()
                .addComponent(botao_primeiro)
                .addGap(6, 6, 6)
                .addComponent(botao_anterior)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(field_codigo1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botao_proximo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botao_ultimo))
        );
        panel2Layout.setVerticalGroup(
            panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(field_codigo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botao_anterior, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(botao_ultimo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(botao_proximo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(botao_primeiro))
                .addGap(18, 18, 18)
                .addGroup(panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(label_estoque)
                    .addComponent(field_estoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(21, 21, 21))
        );

        botao_excluir.setFont(new java.awt.Font("Tahoma", 1, 14));
        botao_excluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/delete_registro.gif"))); // NOI18N
        botao_excluir.setText("Excluir");
        botao_excluir.setToolTipText("Excluir cliente");
        botao_excluir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_excluirActionPerformed(evt);
            }
        });

        botao_gravar.setFont(new java.awt.Font("Tahoma", 1, 14));
        botao_gravar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/grava_registro.gif"))); // NOI18N
        botao_gravar.setText("Gravar");
        botao_gravar.setToolTipText("Gravar novo cliente");
        botao_gravar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_gravarActionPerformed(evt);
            }
        });

        botao_alterar.setFont(new java.awt.Font("Tahoma", 1, 14));
        botao_alterar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/alterar_registro.gif"))); // NOI18N
        botao_alterar.setText("Alterar");
        botao_alterar.setToolTipText("Alterar cliente cadastrado");
        botao_alterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_alterarActionPerformed(evt);
            }
        });

        botao_novo.setFont(new java.awt.Font("Tahoma", 1, 14));
        botao_novo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/novo_registro.gif"))); // NOI18N
        botao_novo.setText("Novo");
        botao_novo.setToolTipText("Novo registro");
        botao_novo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_novoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(14, Short.MAX_VALUE)
                .addComponent(botao_novo, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botao_gravar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botao_alterar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botao_excluir))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(botao_alterar, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(botao_excluir, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(botao_gravar, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(botao_novo, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        label_nome.setFont(new java.awt.Font("Tahoma", 0, 14));
        label_nome.setText("Nome:");

        label_marca.setFont(new java.awt.Font("Tahoma", 0, 14));
        label_marca.setText("Marca:");

        label_fornecedor1.setFont(new java.awt.Font("Tahoma", 0, 14));
        label_fornecedor1.setText("Unidade:");

        combo_unidade.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Kg", "Grama", "Litro", "Caixa", "Galão", "Pacote" }));

        label_descricao.setFont(new java.awt.Font("Tahoma", 0, 14));
        label_descricao.setText("Descrição:");

        textArea_descricao.setColumns(20);
        textArea_descricao.setFont(textArea_descricao.getFont());
        textArea_descricao.setRows(5);
        textArea_descricao.setToolTipText("Anotações importantes sobre o animal");
        scrollPane_descricao.setViewportView(textArea_descricao);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(scrollPane_descricao, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(label_fornecedor1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(combo_unidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(label_descricao, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(label_nome)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(field_nome, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(label_marca)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(field_marca, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_nome)
                    .addComponent(field_nome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(field_marca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label_marca))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(combo_unidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label_fornecedor1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(label_descricao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(scrollPane_descricao, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)
                .addContainerGap())
        );

        panel_pesquisar.setBackground(new java.awt.Color(153, 255, 153));

        field_pesquisa.setToolTipText("Digite aqui as iniciais do cliente.");
        field_pesquisa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                field_pesquisaActionPerformed(evt);
            }
        });

        label_pesquisar.setFont(new java.awt.Font("Tahoma", 1, 14));
        label_pesquisar.setText("PESQUISAR:");

        javax.swing.GroupLayout panel_pesquisarLayout = new javax.swing.GroupLayout(panel_pesquisar);
        panel_pesquisar.setLayout(panel_pesquisarLayout);
        panel_pesquisarLayout.setHorizontalGroup(
            panel_pesquisarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_pesquisarLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(label_pesquisar)
                .addGap(18, 18, 18)
                .addComponent(field_pesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(20, Short.MAX_VALUE))
        );
        panel_pesquisarLayout.setVerticalGroup(
            panel_pesquisarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_pesquisarLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panel_pesquisarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_pesquisar)
                    .addComponent(field_pesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        label_titulo.setFont(label_titulo.getFont().deriveFont(label_titulo.getFont().getStyle() | java.awt.Font.BOLD, 25));
        label_titulo.setForeground(new java.awt.Color(255, 0, 0));
        label_titulo.setText("Cadastro de Produtos");

        javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1);
        panel1.setLayout(panel1Layout);
        panel1Layout.setHorizontalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel1Layout.createSequentialGroup()
                .addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panel_pesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(panel1Layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(label_titulo)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panel1Layout.setVerticalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(label_titulo)
                .addGap(18, 18, 18)
                .addComponent(panel_pesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        label_fornecedor.setFont(new java.awt.Font("Tahoma", 0, 14));
        label_fornecedor.setText("Fornecedores:");

        combo_fornecedor.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Escolha" }));
        combo_fornecedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                combo_fornecedorActionPerformed(evt);
            }
        });

        jButton1.setText("Lançar");

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Cod.", "Nome", "Telefone"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jTable1);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 365, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                        .addComponent(label_fornecedor)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(combo_fornecedor, 0, 202, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1)))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(combo_fornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label_fornecedor)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        botao_entrada.setFont(new java.awt.Font("Tahoma", 1, 16));
        botao_entrada.setForeground(new java.awt.Color(255, 0, 0));
        botao_entrada.setText("Entrada");
        botao_entrada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_entradaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(6, 6, 6)
                                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(85, 85, 85)
                                        .addComponent(botao_entrada, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(panel_produtoPet, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(162, 162, 162)
                                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(67, 67, 67)
                        .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(119, 119, 119)
                        .addComponent(panel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(78, 78, 78))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(panel2, 0, 102, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(panel_produtoPet, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(11, 11, 11)
                                .addComponent(botao_entrada, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-999)/2, (screenSize.height-401)/2, 999, 401);
    }// </editor-fold>//GEN-END:initComponents

    private void botao_primeiroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_primeiroActionPerformed
        //this.setAtributos(control.primeiroCliente());
}//GEN-LAST:event_botao_primeiroActionPerformed

    private void botao_anteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_anteriorActionPerformed
        /*try {
            ArrayList<String> result;
            if(field_cod_cliente.getText().equalsIgnoreCase("")){
                result = control.primeiroCliente();
                this.setAtributos(result);
            } else {
                result = control.anteriorCliente(field_cod_cliente.getText());
                this.setAtributos(result);
            }
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null,"Primeiro cliente cadastrado. Não exitem mais cadastros anteriores.");
        }*/
}//GEN-LAST:event_botao_anteriorActionPerformed

    private void botao_proximoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_proximoActionPerformed
        /*try {
            ArrayList<String> result;
            if(field_cod_cliente.getText().equalsIgnoreCase("")){
                result = control.primeiroCliente();
                this.setAtributos(result);
            } else {
                result = control.proximoCliente(field_cod_cliente.getText());
                this.setAtributos(result);
            }
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null,"Ultimo cliente cadastrado. Não exitem mais cadastros.");
        }*/
}//GEN-LAST:event_botao_proximoActionPerformed

    private void botao_ultimoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_ultimoActionPerformed
        //this.setAtributos(control.ultimoCliente());
}//GEN-LAST:event_botao_ultimoActionPerformed

    private void field_pesquisaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_field_pesquisaActionPerformed
        /*try {
            this.setAtributos(control.pesquisa_digitacao(field_pesquisa.getText().length(), field_pesquisa.getText()));
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }*/
}//GEN-LAST:event_field_pesquisaActionPerformed

    private void botao_gravarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_gravarActionPerformed
        /*try {
            control.cadastraCliente(
                    field_nome.getText(),
                    field_cpf.getText(),
                    field_email.getText(),
                    field_end_rua.getText(),
                    field_end_bairro.getText(),
                    field_end_bairro.getText(),
                    field_end_cidade.getText(),
                    field_tel_celular.getText(),
                    field_tel_comercial.getText(),
                    field_tel_residencial.getText());
            this.limpaFields();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage());
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }*/
}//GEN-LAST:event_botao_gravarActionPerformed

    private void botao_excluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_excluirActionPerformed
        /*if(!field_cod_cliente.getText().equalsIgnoreCase("")){
            control.excluir(field_cod_cliente.getText());
            this.limpaFields();
        }*/
}//GEN-LAST:event_botao_excluirActionPerformed

    private void botao_novoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_novoActionPerformed
        //this.limpaFields();
}//GEN-LAST:event_botao_novoActionPerformed

    private void botao_alterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_alterarActionPerformed
        /*try {
            control.alterarCliente(
                    field_cod_cliente.getText(),
                    field_nome.getText(),
                    field_cpf.getText(),
                    field_email.getText(),
                    field_end_rua.getText(),
                    field_end_bairro.getText(),
                    field_end_bairro.getText(),
                    field_end_cidade.getText(),
                    field_tel_celular.getText(),
                    field_tel_comercial.getText(),
                    field_tel_residencial.getText());
            this.limpaFields();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage());
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }*/
}//GEN-LAST:event_botao_alterarActionPerformed

    private void combo_fornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_combo_fornecedorActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_combo_fornecedorActionPerformed

    private void radio_suspenderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radio_suspenderActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_radio_suspenderActionPerformed

    private void botao_entradaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_entradaActionPerformed
        control.chamaAlerta();
        
    }//GEN-LAST:event_botao_entradaActionPerformed

    private void radio_disponivelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radio_disponivelActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_radio_disponivelActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botao_alterar;
    private javax.swing.JButton botao_anterior;
    private javax.swing.JButton botao_entrada;
    private javax.swing.JButton botao_excluir;
    private javax.swing.JButton botao_gravar;
    private javax.swing.JButton botao_novo;
    private javax.swing.JButton botao_primeiro;
    private javax.swing.JButton botao_proximo;
    private javax.swing.JButton botao_ultimo;
    private javax.swing.JComboBox combo_fornecedor;
    private javax.swing.JComboBox combo_unidade;
    private java.awt.TextField field_codigo1;
    private java.awt.TextField field_estoque;
    private javax.swing.JTextField field_marca;
    private javax.swing.JTextField field_nome;
    private javax.swing.JTextField field_nome1;
    private javax.swing.JTextField field_pesquisa;
    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JLabel label_descricao;
    private javax.swing.JLabel label_disponibilidade;
    private javax.swing.JLabel label_estoque;
    private javax.swing.JLabel label_fornecedor;
    private javax.swing.JLabel label_fornecedor1;
    private javax.swing.JLabel label_marca;
    private javax.swing.JLabel label_nome;
    private javax.swing.JLabel label_pesquisar;
    private javax.swing.JLabel label_preco;
    private javax.swing.JLabel label_produtoPet;
    private javax.swing.JLabel label_titulo;
    private javax.swing.JPanel panel1;
    private javax.swing.JPanel panel2;
    private javax.swing.JPanel panel_pesquisar;
    private javax.swing.JPanel panel_produtoPet;
    private javax.swing.JRadioButton radio_disponivel;
    private javax.swing.JRadioButton radio_suspender;
    private javax.swing.JScrollPane scrollPane_descricao;
    private javax.swing.JTextArea textArea_descricao;
    // End of variables declaration//GEN-END:variables
}


